home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************************
-
- File: dprintf.c
-
- Copyright © 1996, 1997, 1998 Apple Computer, Inc., All Rights Reserved
-
-
- You may incorporate this sample code into your applications without
- restriction, though the sample code has been provided "AS IS" and the
- responsibility for its operation is 100% yours. However, what you are
- not permitted to do is to redistribute the source as "DSC Sample Code"
- after having made changes. If you're going to re-distribute the source,
- we require that you make it clear in the source that the code was
- descended from Apple Sample Code, but that you've made changes.
-
- *************************************************************************************/
- #include <MacTypes.h>
- #include "dprintf.h"
-
- static void debug_message(
- char *msg)
- {
- // mb_printf(msg);
- debugstr(msg);
-
- return;
- }
-
-
- int dprintf(
- const char *format,
- ...)
- {
- char buffer[257]; /* [length byte] + [255 string bytes] + [null] */
- va_list arglist;
- int return_value = 0;
-
- #if DEBUG
- va_start(arglist, format);
- return_value= vsprintf(buffer, format, arglist);
- va_end(arglist);
-
- debug_message(buffer);
- #else
- arglist;
- buffer;
- format;
-
- #endif
- return return_value;
- }
-
-